<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<form method="post" class="layui-from" onsubmit="return false">
		账号：<input type="text" name="name" placeholder="请输入原账号"><br>
		密码：<input type="text" name="pwd"  placeholder="请输入修改后的密码"><br>
		<input type="submit" value="修改"><br>
	</form>
	<script type="text/javascript" src="lay/jquery.min.js"></script>
	<script type="text/javascript" src="layui.js"></script>
	<script type="text/javascript">
		$(function() {
			$(".layui-from").submit(function() {
				$.post(
					"update",
					$(this).serialize(),
					function(data) {
						if (data.success) {
							layer.msg("修改成功");
							window.location.href="Deng.html";
						} else {
							layer.msg("修改失败");
						}
					}
				)
			})
		})
		
	</script>
</body>
</html>